var a = require("../../../@babel/runtime/helpers/interopRequireDefault")(require("../../../@babel/runtime/regenerator")), t = require("../../../@babel/runtime/helpers/asyncToGenerator"), e = getApp();

Page({
    data: {
        avatar_image: "",
        active: 0,
        username: "",
        total_reward: 0,
        integral: "积分",
        list: [],
        total_page: 1,
        page: 1
    },
    onLoad: function() {
        var a = wx.getStorageSync("langIndex");
        this.setData({
            language: a.en
        });
        var t = wx.getStorageSync("integral");
        t && this.setData({
            integral: t
        }), this.get_data();
    },
    get_data: function() {
        var n, r = this, i = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 1;
        e._postNetWork({
            url: e.getNetAddresss("plugin.static-point-dividend.frontend.reward-log.getRewardList"),
            data: {
                page: i
            },
            success: (n = t(a.default.mark(function t(n) {
                var o, s, u, g, d, l, c, p;
                return a.default.wrap(function(a) {
                    for (;;) switch (a.prev = a.next) {
                      case 0:
                        o = n.data, s = o.result, u = o.msg, s ? (g = n.data.data, d = g.list, l = g.plugin_name, 
                        c = g.reward_summarize, p = [], p = 1 == i ? d.data || [] : r.data.list.concat(d.data), 
                        r.data.total_page = d.last_page, r.data.page = d.current_page, r.setData({
                            list: p,
                            username: c.member_info.username,
                            avatar_image: c.member_info.avatar_image,
                            total_reward: c.total_reward
                        }), wx.setNavigationBarTitle({
                            title: l
                        })) : e.tips(u);

                      case 2:
                      case "end":
                        return a.stop();
                    }
                }, t);
            })), function(a) {
                return n.apply(this, arguments);
            })
        });
    },
    onReady: function() {},
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {
        if (this.data.page >= this.data.total_page) return !1;
        var a = this.data.page + 1;
        this.get_data(a);
    },
    onShareAppMessage: function() {}
});